<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/details/httpFile.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_ae5bdaf1b45f3c0e6fd5dd3984d2eafd.html">details</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">httpFile.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../db/df9/http_file_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;list&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;curl/curl.h&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &quot;<a class="code" href="../../d3/df7/ary__str_8hpp.html">ary_str.hpp</a>&quot;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#include &quot;<a class="code" href="../../dd/dce/thread_pool_8hpp.html">threadPool.hpp</a>&quot;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#include &quot;<a class="code" href="../../dc/d8b/file_svr_itfc_8hpp.html">details/fileSvrItfc.hpp</a>&quot;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#include &quot;<a class="code" href="../../df/d05/timer_8hpp.html">timer.hpp</a>&quot;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d8d/namespacewheels.html">wheels</a> {</div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../d3/d55/classwheels_1_1curl_http.html">   20</a></span>    <span class="keyword">class </span><a class="code hl_class" href="../../d3/d55/classwheels_1_1curl_http.html">curlHttp</a> : <span class="keyword">public</span> <a class="code hl_struct" href="../../d7/d64/structwheels_1_1i_file_service.html">iFileService</a></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>    {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>        <span class="keyword">friend</span> <span class="keywordtype">size_t</span> <a class="code hl_friend" href="../../d3/d55/classwheels_1_1curl_http.html#af6b3ef69aa0868252bc8deeefa960558">curlHttp_write_callback</a>(<span class="keywordtype">char</span> *ptr, <span class="keywordtype">size_t</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#adbd8973f289389753695f519d1a892eb">size</a>, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">void</span> *obj );</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>        <span class="comment">// 要下载的文件和下载目标</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d3/d55/classwheels_1_1curl_http.html#a2efcdd910b32509d11ce11909184e572">   25</a></span>        <span class="keyword">using </span><a class="code hl_typedef" href="../../d3/d55/classwheels_1_1curl_http.html#a2efcdd910b32509d11ce11909184e572">fileRecord_t</a> = std::pair&lt;std::string , std::string&gt;;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../d3/d55/classwheels_1_1curl_http.html#af5c5bee54b1a7867660c3bdef808e0b5">   26</a></span>        <span class="keyword">using </span><a class="code hl_typedef" href="../../d3/d55/classwheels_1_1curl_http.html#af5c5bee54b1a7867660c3bdef808e0b5">files_t</a> = std::list&lt;fileRecord_t &gt;;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../d3/d55/classwheels_1_1curl_http.html#a0b5f19f4956965fdb7dafb3f23b1cafa">   28</a></span>        <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">long</span> <a class="code hl_variable" href="../../d3/d55/classwheels_1_1curl_http.html#a0b5f19f4956965fdb7dafb3f23b1cafa">DEFAULT_BUFFER_SIZE</a>; <span class="comment">// 默认5M的下载内存缓冲</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../d3/d55/classwheels_1_1curl_http.html#ae5bf97a9d7c213107a2a765f9a47ce42">   29</a></span>        <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d3/d55/classwheels_1_1curl_http.html#ae5bf97a9d7c213107a2a765f9a47ce42">DEFAULT_THD_COUNT</a>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d3/d55/classwheels_1_1curl_http.html#a7e90ecf12420b8445e9c5cc0d6bf6664">   30</a></span>        <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">long</span> <a class="code hl_variable" href="../../d3/d55/classwheels_1_1curl_http.html#a7e90ecf12420b8445e9c5cc0d6bf6664">DEFAULT_OVERTIME</a>;                <span class="comment">// http通讯超时时间</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>        std::atomic&lt; long &gt;              m_buff_size__;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>        std::shared_ptr&lt; files_t &gt;       m_files__;          <span class="comment">// 如果使用延迟异步下载，所有要下载的目标路径添加在这里</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>        std::shared_ptr&lt; threadPool &gt;    pt_thd_pool__;      <span class="comment">// 使用延迟异步下载的线程池</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>        std::mutex                       m_mutex__;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>        std::function&lt; bool ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , uint8_t * , <span class="keywordtype">size_t</span> ) &gt;         m_cb__;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>        std::function&lt; bool ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , <span class="keywordtype">size_t</span> , <span class="keywordtype">int</span> , <span class="keyword">const</span> std::string&amp; ) &gt;   m_cb1__;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>        <a class="code hl_class" href="../../db/d3e/classwheels_1_1_c_timer.html">CTimer</a>                           m_timer__;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>        std::atomic&lt; long &gt;              m_overtime__;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        <span class="keywordtype">bool</span> download__( <span class="keyword">const</span> std::string&amp; from , <span class="keyword">const</span> std::string&amp; dest );</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>        <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#ad39618e4f910e9a9681cd76578ddfd3d">curlHttp</a>();</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>        <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#afcfe51e26d099be3f60293b203129557">~curlHttp</a>();</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>        </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a4c133a2aae1b9855feeaf9b859d321f0">bufferSize</a>( <span class="keywordtype">size_t</span> s ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../d3/d55/classwheels_1_1curl_http.html#a93b79ebe38efd6f8766f03f8c921bf32">   50</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a93b79ebe38efd6f8766f03f8c921bf32">overtime</a>( <span class="keywordtype">long</span> seconds ) <span class="keyword">final</span>{ m_overtime__ = seconds; }</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a21da1d59073f864299d4c9d54683d385">download</a>( <span class="keyword">const</span> std::string&amp; from , <span class="keyword">const</span> std::string&amp; dest = <span class="stringliteral">&quot;&quot;</span> , <span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a21da1d59073f864299d4c9d54683d385">download</a>( <span class="keyword">const</span> std::string&amp; from , <span class="keyword">const</span> std::string&amp; dest , std::function&lt; <span class="keywordtype">bool</span> ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , uint8_t * ,<span class="keywordtype">size_t</span>  ) &gt; cb , <span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a21da1d59073f864299d4c9d54683d385">download</a>( <span class="keyword">const</span> std::string&amp; from , <span class="keywordtype">char</span> * buffer , std::function&lt; <span class="keywordtype">bool</span> ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , uint8_t * ,<span class="keywordtype">size_t</span> ) &gt; cb , <span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a21da1d59073f864299d4c9d54683d385">download</a>( <span class="keyword">const</span> <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; from , <span class="keyword">const</span> <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; dest , <span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a21da1d59073f864299d4c9d54683d385">download</a>( <span class="keyword">const</span> <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; from , <span class="keyword">const</span> <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; dest , std::function&lt; <span class="keywordtype">bool</span> ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , uint8_t * ,<span class="keywordtype">size_t</span> ) &gt; cb, <span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a869dd5ae61ecc763d19a2b316b82e021">upload</a>( <span class="keyword">const</span> std::string&amp; file ,  <span class="keyword">const</span> std::string&amp; remote_file ,  <span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a869dd5ae61ecc763d19a2b316b82e021">upload</a>( <span class="keyword">const</span> std::string&amp; file ,  <span class="keyword">const</span> std::string&amp; remote_file, std::function&lt; <span class="keywordtype">bool</span> ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , <span class="keywordtype">size_t</span> )&gt; cb ,<span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a869dd5ae61ecc763d19a2b316b82e021">upload</a>( <span class="keyword">const</span> <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; from , <span class="keywordtype">bool</span> autoRun = <span class="keyword">true</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a869dd5ae61ecc763d19a2b316b82e021">upload</a>( <span class="keyword">const</span> <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; file , std::function&lt; <span class="keywordtype">bool</span> ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , <span class="keywordtype">size_t</span> )&gt; cb , <span class="keywordtype">bool</span> autoRun ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a896d85e83b36058f957a9988fa75f385">del</a>( <span class="keyword">const</span> std::string&amp; rem ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a007996079e967c2149e3062930e863c3">setUser</a>( <span class="keyword">const</span> std::string&amp; acc , <span class="keyword">const</span> std::string&amp; pswd ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a68ba399064b9b5f56c0d85fe407643b4">addUrl</a>( <span class="keyword">const</span> std::string&amp; url ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a2a6c6114d060117099988de17487e174">run</a>() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a2a6c6114d060117099988de17487e174">run</a>( std::function&lt; <span class="keywordtype">bool</span> ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , <span class="keywordtype">size_t</span> , <span class="keywordtype">int</span> , <span class="keyword">const</span> std::string&amp; ) &gt; cb ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>        <span class="keyword">virtual</span> <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a304fe385a4b2f0f38a893494de7ba827">ls</a>( <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; rst ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a304fe385a4b2f0f38a893494de7ba827">ls</a>( std::function&lt; <span class="keywordtype">void</span> ( <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> , <a class="code hl_typedef" href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">ArrayString</a>&amp; ) &gt; cb ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span>        <span class="keyword">virtual</span> <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#aeef247fb37efdd445f4f69da0adeca3b">access</a>( <span class="keyword">const</span> std::string&amp; url , <span class="keywordtype">int</span> type ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>        <span class="keyword">virtual</span> <a class="code hl_enumeration" href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">emErrCode</a> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a4637ba5bdafa422175855e699c4b4cc1">cd</a>( <span class="keyword">const</span> std::string&amp; path ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>        <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#adbd8973f289389753695f519d1a892eb">size</a>( <span class="keyword">const</span> std::string&amp; file ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span> </div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d55/classwheels_1_1curl_http.html#a7bf1cb79c4dc4484621de444d1f29b0d">on_recv__</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * data , <span class="keywordtype">size_t</span> len , std::shared_ptr&lt; std::ofstream &gt;);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>    };</div>
</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>}</div>
<div class="ttc" id="aary__str_8hpp_html"><div class="ttname"><a href="../../d3/df7/ary__str_8hpp.html">ary_str.hpp</a></div></div>
<div class="ttc" id="aclasswheels_1_1_c_timer_html"><div class="ttname"><a href="../../db/d3e/classwheels_1_1_c_timer.html">wheels::CTimer</a></div><div class="ttdef"><b>定义</b> <a href="../../df/d05/timer_8hpp_source.html#l00026">timer.hpp:27</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html">wheels::curlHttp</a></div><div class="ttdef"><b>定义</b> <a href="#l00020">httpFile.hpp:21</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a007996079e967c2149e3062930e863c3"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a007996079e967c2149e3062930e863c3">wheels::curlHttp::setUser</a></div><div class="ttdeci">virtual void setUser(const std::string &amp;acc, const std::string &amp;pswd) override</div><div class="ttdoc">设置用户名和密码</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00291">httpFile.cpp:291</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a0b5f19f4956965fdb7dafb3f23b1cafa"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a0b5f19f4956965fdb7dafb3f23b1cafa">wheels::curlHttp::DEFAULT_BUFFER_SIZE</a></div><div class="ttdeci">static const long DEFAULT_BUFFER_SIZE</div><div class="ttdef"><b>定义</b> <a href="#l00028">httpFile.hpp:28</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a21da1d59073f864299d4c9d54683d385"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a21da1d59073f864299d4c9d54683d385">wheels::curlHttp::download</a></div><div class="ttdeci">virtual bool download(const std::string &amp;from, const std::string &amp;dest=&quot;&quot;, bool autoRun=true) override</div><div class="ttdoc">下载文件操作</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00159">httpFile.cpp:159</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a2a6c6114d060117099988de17487e174"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a2a6c6114d060117099988de17487e174">wheels::curlHttp::run</a></div><div class="ttdeci">virtual void run() override</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00302">httpFile.cpp:302</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a2efcdd910b32509d11ce11909184e572"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a2efcdd910b32509d11ce11909184e572">wheels::curlHttp::fileRecord_t</a></div><div class="ttdeci">std::pair&lt; std::string, std::string &gt; fileRecord_t</div><div class="ttdef"><b>定义</b> <a href="#l00025">httpFile.hpp:25</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a304fe385a4b2f0f38a893494de7ba827"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a304fe385a4b2f0f38a893494de7ba827">wheels::curlHttp::ls</a></div><div class="ttdeci">virtual emErrCode ls(ArrayString &amp;rst) override</div><div class="ttdoc">列出远程目录内容</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00336">httpFile.cpp:336</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a4637ba5bdafa422175855e699c4b4cc1"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a4637ba5bdafa422175855e699c4b4cc1">wheels::curlHttp::cd</a></div><div class="ttdeci">virtual emErrCode cd(const std::string &amp;path) override</div><div class="ttdoc">切换远程目录路径</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00356">httpFile.cpp:356</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a4c133a2aae1b9855feeaf9b859d321f0"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a4c133a2aae1b9855feeaf9b859d321f0">wheels::curlHttp::bufferSize</a></div><div class="ttdeci">virtual void bufferSize(size_t s) override</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00153">httpFile.cpp:153</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a68ba399064b9b5f56c0d85fe407643b4"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a68ba399064b9b5f56c0d85fe407643b4">wheels::curlHttp::addUrl</a></div><div class="ttdeci">virtual void addUrl(const std::string &amp;url) override</div><div class="ttdoc">指定URL</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00297">httpFile.cpp:297</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a7bf1cb79c4dc4484621de444d1f29b0d"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a7bf1cb79c4dc4484621de444d1f29b0d">wheels::curlHttp::on_recv__</a></div><div class="ttdeci">void on_recv__(const char *data, size_t len, std::shared_ptr&lt; std::ofstream &gt;)</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00040">httpFile.cpp:40</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a7e90ecf12420b8445e9c5cc0d6bf6664"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a7e90ecf12420b8445e9c5cc0d6bf6664">wheels::curlHttp::DEFAULT_OVERTIME</a></div><div class="ttdeci">static const long DEFAULT_OVERTIME</div><div class="ttdef"><b>定义</b> <a href="#l00030">httpFile.hpp:30</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a869dd5ae61ecc763d19a2b316b82e021"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a869dd5ae61ecc763d19a2b316b82e021">wheels::curlHttp::upload</a></div><div class="ttdeci">virtual bool upload(const std::string &amp;file, const std::string &amp;remote_file, bool autoRun=true) override</div><div class="ttdoc">上传文件到服务器</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00254">httpFile.cpp:254</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a896d85e83b36058f957a9988fa75f385"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a896d85e83b36058f957a9988fa75f385">wheels::curlHttp::del</a></div><div class="ttdeci">virtual bool del(const std::string &amp;rem) override</div><div class="ttdoc">删除远程文件</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00285">httpFile.cpp:285</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_a93b79ebe38efd6f8766f03f8c921bf32"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#a93b79ebe38efd6f8766f03f8c921bf32">wheels::curlHttp::overtime</a></div><div class="ttdeci">virtual void overtime(long seconds) final</div><div class="ttdef"><b>定义</b> <a href="#l00050">httpFile.hpp:50</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_ad39618e4f910e9a9681cd76578ddfd3d"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#ad39618e4f910e9a9681cd76578ddfd3d">wheels::curlHttp::curlHttp</a></div><div class="ttdeci">curlHttp()</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00050">httpFile.cpp:50</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_adbd8973f289389753695f519d1a892eb"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#adbd8973f289389753695f519d1a892eb">wheels::curlHttp::size</a></div><div class="ttdeci">virtual size_t size(const std::string &amp;file) override</div><div class="ttdoc">读取远程文件的文件大小</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00362">httpFile.cpp:362</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_ae5bf97a9d7c213107a2a765f9a47ce42"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#ae5bf97a9d7c213107a2a765f9a47ce42">wheels::curlHttp::DEFAULT_THD_COUNT</a></div><div class="ttdeci">static const int DEFAULT_THD_COUNT</div><div class="ttdef"><b>定义</b> <a href="#l00029">httpFile.hpp:29</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_aeef247fb37efdd445f4f69da0adeca3b"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#aeef247fb37efdd445f4f69da0adeca3b">wheels::curlHttp::access</a></div><div class="ttdeci">virtual emErrCode access(const std::string &amp;url, int type) override</div><div class="ttdoc">和linux access函数一样，用来检查文件的可访问性</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00348">httpFile.cpp:348</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_af5c5bee54b1a7867660c3bdef808e0b5"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#af5c5bee54b1a7867660c3bdef808e0b5">wheels::curlHttp::files_t</a></div><div class="ttdeci">std::list&lt; fileRecord_t &gt; files_t</div><div class="ttdef"><b>定义</b> <a href="#l00026">httpFile.hpp:26</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_af6b3ef69aa0868252bc8deeefa960558"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#af6b3ef69aa0868252bc8deeefa960558">wheels::curlHttp::curlHttp_write_callback</a></div><div class="ttdeci">friend size_t curlHttp_write_callback(char *ptr, size_t size, size_t nmemb, void *obj)</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00025">httpFile.cpp:25</a></div></div>
<div class="ttc" id="aclasswheels_1_1curl_http_html_afcfe51e26d099be3f60293b203129557"><div class="ttname"><a href="../../d3/d55/classwheels_1_1curl_http.html#afcfe51e26d099be3f60293b203129557">wheels::curlHttp::~curlHttp</a></div><div class="ttdeci">~curlHttp()</div><div class="ttdef"><b>定义</b> <a href="../../d3/de0/http_file_8cpp_source.html#l00071">httpFile.cpp:71</a></div></div>
<div class="ttc" id="afile_svr_itfc_8hpp_html"><div class="ttname"><a href="../../dc/d8b/file_svr_itfc_8hpp.html">fileSvrItfc.hpp</a></div></div>
<div class="ttc" id="anamespacewheels_html"><div class="ttname"><a href="../../df/d8d/namespacewheels.html">wheels</a></div><div class="ttdoc">堆栈信息读取和保存记录</div><div class="ttdef"><b>定义</b> <a href="../../d3/df7/ary__str_8hpp_source.html#l00006">ary_str.hpp:7</a></div></div>
<div class="ttc" id="anamespacewheels_html_a17042f775c3493c1f9592ca7883dbd5e"><div class="ttname"><a href="../../df/d8d/namespacewheels.html#a17042f775c3493c1f9592ca7883dbd5e">wheels::ArrayString</a></div><div class="ttdeci">ary_str ArrayString</div><div class="ttdef"><b>定义</b> <a href="../../d3/df7/ary__str_8hpp_source.html#l00010">ary_str.hpp:10</a></div></div>
<div class="ttc" id="astructwheels_1_1i_file_service_html"><div class="ttname"><a href="../../d7/d64/structwheels_1_1i_file_service.html">wheels::iFileService</a></div><div class="ttdef"><b>定义</b> <a href="../../dc/d8b/file_svr_itfc_8hpp_source.html#l00013">fileSvrItfc.hpp:14</a></div></div>
<div class="ttc" id="astructwheels_1_1i_file_service_html_a4caa50c3e01e22c71bb52d16657c48d0"><div class="ttname"><a href="../../d7/d64/structwheels_1_1i_file_service.html#a4caa50c3e01e22c71bb52d16657c48d0">wheels::iFileService::emErrCode</a></div><div class="ttdeci">emErrCode</div><div class="ttdef"><b>定义</b> <a href="../../dc/d8b/file_svr_itfc_8hpp_source.html#l00015">fileSvrItfc.hpp:15</a></div></div>
<div class="ttc" id="athread_pool_8hpp_html"><div class="ttname"><a href="../../dd/dce/thread_pool_8hpp.html">threadPool.hpp</a></div></div>
<div class="ttc" id="atimer_8hpp_html"><div class="ttname"><a href="../../df/d05/timer_8hpp.html">timer.hpp</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
